package com.burstly.lib.network.request;

import com.burstly.lib.network.beans.cookie.ICookieRequest;
import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.Utils;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.util.EntityUtils;

final class DownloadServerListTask<T> extends BurstlyRequestTask<T>
{
  DownloadServerListTask(ICookieRequest paramICookieRequest, String paramString1, Class<T> paramClass, String paramString2)
  {
    super(paramICookieRequest, paramString1, paramClass, paramString2);
    setShouldUseSecondLevelServers(false);
  }

  protected String handleConnectLogic(HttpHost paramHttpHost, HttpPost paramHttpPost)
    throws UnsupportedEncodingException, IOException, ClientProtocolException
  {
    HttpResponse localHttpResponse = Utils.makeRequest(paramHttpHost, paramHttpPost);
    int i = localHttpResponse.getStatusLine().getStatusCode();
    if (i != 200)
    {
      LoggerExt localLoggerExt = LOG;
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = paramHttpHost.getHostName();
      arrayOfObject[1] = String.valueOf(i);
      localLoggerExt.logError("BurstlyRequestTask", "Request to {0} has finished with {1} http status.", arrayOfObject);
      return null;
    }
    String str = EntityUtils.toString(localHttpResponse.getEntity(), "utf-8");
    LOG.logDebug("BurstlyRequestTask", "Raw response data : {0}", new Object[] { str });
    return str;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.network.request.DownloadServerListTask
 * JD-Core Version:    0.6.2
 */